﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RpcGenerator.AS3
{
    class AS3ShareFieldGenerator
    {
        public void Generate(MessageFieldDescription description, IMessageSerializer serializer)
        {
            BeginExtension(description, serializer);

            //BeginRead(description, serializer);
            //EndRead(serializer);

            //BeginWrite(description, serializer);
            //EndWrite(serializer);

            EndExtension(serializer);
        }

        private void BeginExtension(MessageFieldDescription description, IMessageSerializer serializer)
        {
            serializer.NewLine();
            serializer.NewLine(string.Format("static class {0}Extension", description.Type.Name));
            serializer.BeginBlock();
        }

        private void EndExtension(IMessageSerializer serializer)
        {
            serializer.EndBlock();
        }
    }
}
